The disclosure is generally directed to managing data replication and, more particularly, to techniques for managing a data replication mode from primary storage to secondary storage.
In order to improve the security of data storage and to prevent the occurrence of disasters, it is often required to replicate data in a primary storage to a secondary storage, so as to make a backup of data. Generally, two technologies in the prior art, synchronous replication and asynchronous replication, are used to implement data backup.
FIGS. 1A and 1B show processes of data replication in the prior art, with FIG. 1A showing a process of synchronous replication and FIG. 1B showing a process of asynchronous replication. Specifically, as shown in FIG. 1A, in the case of synchronous replication, a mirroring relationship is established between a primary storage device and a secondary storage device in advance. Whenever the primary storage device receives, from a locally connected host, a command of writing data (step (1)), it not only writes data in its local disk system according to the command, but also forwards the data to the secondary storage device (step (2)). Once the secondary storage device completes data writing, it will return a notification of writing completion to the primary storage device (step (3)). Upon the receipt of such notification, the primary storage device will return a report of writing completion to the host (step (4)). Therefore, with a scheme of synchronous replication, both the primary storage device and the secondary storage device maintain the latest updates. Usually, the primary storage device and the secondary storage device are connected remotely and implement high-speed data replication through an optical fiber network. Such data replication is also called Synchronous Mirror.
In the case of asynchronous replication, as shown in FIG. 1B, whenever the primary storage device receives a command of writing data from a locally connected host (step (1)), it will write data in its local disk system according to the command, and immediately returns a report of writing completion to the host (step (2)). After a certain time interval, the primary storage device forwards data updated during the time interval to the secondary storage device (step (3)). After the secondary storage device completes writing of the updated data, it returns a notification of writing completion to the primary storage device (step (4)). Such data replication is also called Asynchronous Mirror.
Recover Point Object (RPO) is often used in the prior art to describe disaster tolerance capability of a system. Specifically, RPO refers to such a time point before the disaster that data at this time point can be recovered by the system after the occurrence of the disaster. Or in other words, RPO is an index measuring how much data will be lost after the occurrence of the disaster. In the synchronous replication mode, each group of data written to the primary storage device will be backed up synchronously to the secondary storage devices, whereby in the synchronous replication mode RPO=0. In the asynchronous replication mode, there is a time interval between local writing and remote backup of data, whereby RPO>0. More specifically, the value of RPO depends on the time interval for data backup.
Obviously, since in the synchronous replication mode RPO=0, a system employing synchronous replication has stronger disaster tolerance. However, on the other hand, synchronous replication needs to forward data of the primary storage device in real-time to the secondary storage device through a network, thereby needing to occupy a large amount of network bandwidth. When there isn't sufficient network bandwidth resource, the performance of the whole system related with the primary storage devices will be impacted. In contrast, in the asynchronous replication mode, RPO>0, disaster tolerance is not ideal relatively; however, this replication mode occupies a relatively small amount of bandwidth resource, and thus has less impact on the performance of the whole system.
In the prior art, the data replication mode of a storage system is often fixed, so that the storage system cannot be well adapted to different network conditions. Therefore, it is desired to propose an improved scheme so that the storage system can be better adapted to different RPO requirements and bandwidth conditions.